<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<input type="checkbox" id="ck" />
		<hr />
		<div id="div">
			<input type="checkbox"/><br />
			<input type="checkbox" /><br />
			<input type="checkbox" /><br />
			<input type="checkbox" /><br />
			<input type="checkbox" />
		</div>
        <script type="text/javascript">
            document.getElementById("ck").onclick = function(){

            //  let arrDiv = document.getElementById("div");
            //  console.log(arrDiv);
          

            let arrDiv=  document.getElementById("div");
            let arrChild  =  arrDiv.children;
            for(let x=0 ; arrChild.length > x ;  x++){
                arrChild[x].checked=document.getElementById("ck").checked;
            }
            }
        </script>
    
	</body>
</html>